{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "899e3f1d-7996-4eb7-8320-b9779a65381a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "w= [2.13756953] b= [90.78228498]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn.linear_model import LinearRegression\n",
    "x=np.array([[100],[113],[90],[89],[60],[70],[50],[45],[55],[78]])\n",
    "y=np.array([[301],[324],[285],[296],[200],[260],[300],[120],[180],[245]])\n",
    "model=LinearRegression()\n",
    "model.fit(x,y)\n",
    "print(\"w=\",model.coef_[0],\"b=\",model.intercept_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "5a104dd9-3843-49dc-96a4-7b412bc8351f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function matplotlib.pyplot.show(close=None, block=None)>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAGxCAYAAAB1Hiz1AAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAPGRJREFUeJzt3X98U/Wh//F3m5ZCr23TCuLAooW4OaEVvzy6du2GbjJlE65Stz0c3FnUTX6Jvzvl6jZxE/CKiJsKomiB64/p1k6dDycqiELXzjqE1FYvBSvI1PEjTYpIKMn5/pE1NvQHKTQ5Ocnr+XjksUfOOW0+H+uSt+98zjlJhmEYAgAAsLBkswcAAABwogg0AADA8gg0AADA8gg0AADA8gg0AADA8gg0AADA8gg0AADA8gg0AADA8gg0AADA8gg0AADA8kwPNBMnTlRlZaUkqaGhQYWFhcrOzlZFRYU635Wht30AACCxmRponnzySb3yyiuSJK/Xq8mTJ2vcuHGqr69XY2NjMOj0tg8AAC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ABeb1evfjiixo+fLhOOeUUjRgxQna7vT/n0K8INECM83ikigppxYrA87y8wD2Yzj/f1GEBMFe/3stpwIABmjp1qt577z0NGTJERUVF+uCDD/SXv/xFDz74oG644QaNGTNGY8eODftCX88//7xGjhyplJQUFRUVqampSZI0d+5cJSUlBR+da/WGhgYVFhYqOztbFRUVSpD7agLx77XXAlf77Qgz114bOIOJMAMgXMZxuPfee43CwkLjwIEDIdtffPFFY+jQocZ///d/9/rzzc3NRnZ2tvGHP/zB+PTTT40f/ehHRklJiWEYhvHNb37TeOmllwyXy2W4XC7D4/EYhmEYhw4dMs444wxjxowZRnNzs/GDH/zAePzxx8Mes9vtNiQZbre7j7MFEDFut2Fcc41hSIFHXp5hrF9v9qgAxJBwP7/DamjefvttPffcc8FG5JZbblFhYaG2bdsWctykSZO0fv16ffHFF73+vqamJi1YsEA//vGPNXToUM2aNUv19fU6cuSIGhoaNH78eNntdtntdmVkZEiSXn75Zbndbi1ZskSjRo3SggULtHLlyr4nOACxgVYGQD8K6yynbdu2ad68ebr11lt1+eWXa+DAgRo6dKheeOEFvfDCCyHH+v3+Y16fZtKkSSHPP/jgAzkcDm3dulWGYWjs2LHavXu3zjvvPK1YsUIjRozQli1bVFxcrPT0dElSQUGBGhsbe3wNr9cbcraVx+MJZ6oAIo21MgAiIKyGZurUqfroo4+0fPlyvfPOO7rzzjv117/+VQMHDlRaWlrIIykpSSkp4V/e5vDhw1q8eLFmz56tpqYmjR49Wk8//bQaGxuVmpqqGTNmSAoEkry8vODPJSUlyWaz9Xgvm4ULFyorKyv4yM3NDXtMAE6c0+nU/PnzdeONN2r+/PmBO4O/+iqtDICICOssp6O99NJLmjlzps477zz97//+7wkN4Be/+IXWrl2rt99+u8s1bT766CONHDlSLpdLd999t9rb27VkyZLg/tzcXNXW1mr48OFdfm93DU1ubi5nOQER1tzcrPLyctXU1ASvofMfPp8W+f2a0XHQyJGB68oQZAAcQ7hnOfXpSsEdLr74Yv3jH//Qe++9d9wDlKRXX31V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+68fOf/9xoa2sLPvx+f8zNM+4CzdHKy8uNJ554wjCMwClmgwYNMk455RTj5JNPNhoaGswdXD+47bbbDLvdbuTm5hrXXXedceDAAcMw4m+uf/vb34ySkhJj0KBBRl5enlFdXW0YRvzN0zACbyADBgwwmpqaQrbH01z9fr9x5513GiNGjDBSU1ONc88916ivrzcMI77maRiG4XK5jJycHOPvf/97yPZ4mufRH+i9zc3K8w430BhG/MyzurrakNTl0Xl/rMwz4e62vXv3btXX16ukpERDhgwxezgRlShzTZR5SokzV+Zpfb3NLZ7n3RnzjK6ECzQAACD+xN2iYAAAkHgINAAAwPIINAAAwPIINABijmEY8nq9/X4sgPiVYvYAAOBo//znP3XmmWdq0KBBSkpKkhQILvv371dOTk5wmyT5/X6dcsopev/99yVJXq9XjY2NeuONN/TZZ59p0aJFpswBQHRxlhMAS9i8ebOmTJmilpaWbvd/+OGHOu+889Te3q59+/Zp7ty5uuCCC7R//37NmDEj5HTSjz/+WO+8847OOeecKI0eQKTxlRMAS3j55Zd12WWX9bg/Ly9PW7du1SeffKJhw4bpxhtv1A9+8AOlp6dr8uTJamlpCT5OO+00S99XB0BXfOUEICZ98MEHuuiii4LP9+7dq4EDB+pPf/pTyHEZGRlyOp06cuSI0tPT1bl0bm9vD/l6qrOetgOwJhoaADHJMAwdOXJELS0teuyxxzRp0iTt3btXLS0tOnLkiN5//3298cYb+uSTTyRJjz76qHJycpSdna2PPvpI+fn5Gjx4sLZt22byTABEA4EGQExKSQmvQO44btasWTpw4ICeeOIJSdLf/vY3ud1u5eXldftzPp+vfwYKICbwlRMAS/jrX/+qMWPGSJI+++yzbo8xDEP33HOP0tLSdNlll+nXv/61Dh8+rOrqag0ePDh4nMvl0uHDh6MybgDRQaABYAkTJ07UM888I0k67bTTuj3moYce0vDhw/Xpp5/qnnvu0XXXXaf3339fEydODAaaI0eOhN3+ALAOvnICYAkdDc2YMWO6bWhee+013XnnnbrvvvskSWPHjtW7776r1NRUXXzxxXrsscckBYLRk08+GdWxA4g8Ag0AS5g4caIaGhrU0NCgoUOHdtk/duxYVVVV6Ywzzghuy8zM1P333y+fz6crrrhCknTnnXdq1qxZ2rp1a7SGDiAK6F0BxCS/369PP/1UDodDX3zxhTwejxwOhyTp008/1ejRo+Xz+YKnaQ8ePFjjx4+XFPhayTAMvfDCC1q6dKk2bdoUvO7Mt771Ld1888360Y9+pPr6emVkZJgzQQD9ikADICYdOXJEp556qpqbm3s8pqWlReeee26X7W63W4cOHdLTTz+tqqoq5ebmhuy//fbb1d7ezplOQBzh1gcAAMDyWEMDAAAsj0ADAAAsj0ADAAAsj0ADAAAsj0ADAAAsj0ADAAAsj0ADAAAsj0ADAAAsj0ADAAAs7/8DGkRtZYiQpG8AAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "y2=model.predict(x)\n",
    "plt.xlabel('面积')\n",
    "plt.ylabel('售价')\n",
    "plt.rcParams['font.sans-serif']='Simhei'\n",
    "plt.axis([40,125,100,400])\n",
    "plt.scatter(x,y,s=60,c='k',marker='o')\n",
    "plt.plot(x,y2,'r-')\n",
    "plt.show"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "a9def86f-bdb8-4070-8a95-092955f1863a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "w= [3.15636039] b= [0.04433569]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn.linear_model import LinearRegression,SGDRegressor\n",
    "x=np.array([[100],[113],[90],[89],[60],[70],[50],[45],[55],[78]])\n",
    "y=np.array([[301],[324],[285],[296],[200],[260],[300],[120],[180],[245]])\n",
    "model=SGDRegressor(loss='huber',max_iter=5000,random_state=42)\n",
    "model.fit(x,y.ravel())\n",
    "print(\"w=\",model.coef_,\"b=\",model.intercept_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7b94a265-3799-40d8-af14-955b97d47cdd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "bc93d0a1-22cd-4ff6-8296-d4f7633fd969",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Found input variables with inconsistent numbers of samples: [8, 10]",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[21], line 5\u001b[0m\n\u001b[0;32m      3\u001b[0m mse\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39maverage((y2\u001b[38;5;241m-\u001b[39mnp\u001b[38;5;241m.\u001b[39marray(y))\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m2\u001b[39m)\n\u001b[0;32m      4\u001b[0m rmse\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39msqrt(mse)\n\u001b[1;32m----> 5\u001b[0m r2\u001b[38;5;241m=\u001b[39mmodel\u001b[38;5;241m.\u001b[39mscore(x_test,y_test)\n\u001b[0;32m      6\u001b[0m \u001b[38;5;28mprint\u001b[39m(mse)\n\u001b[0;32m      7\u001b[0m \u001b[38;5;28mprint\u001b[39m(rmse)\n",
      "File \u001b[1;32m~\\anaconda3\\Lib\\site-packages\\sklearn\\base.py:663\u001b[0m, in \u001b[0;36mRegressorMixin.score\u001b[1;34m(self, X, y, sample_weight)\u001b[0m\n\u001b[0;32m    660\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmetrics\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m r2_score\n\u001b[0;32m    662\u001b[0m y_pred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpredict(X)\n\u001b[1;32m--> 663\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m r2_score(y, y_pred, sample_weight\u001b[38;5;241m=\u001b[39msample_weight)\n",
      "File \u001b[1;32m~\\anaconda3\\Lib\\site-packages\\sklearn\\utils\\_param_validation.py:216\u001b[0m, in \u001b[0;36mvalidate_params.<locals>.decorator.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m    210\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m    211\u001b[0m     \u001b[38;5;28;01mwith\u001b[39;00m config_context(\n\u001b[0;32m    212\u001b[0m         skip_parameter_validation\u001b[38;5;241m=\u001b[39m(\n\u001b[0;32m    213\u001b[0m             prefer_skip_nested_validation \u001b[38;5;129;01mor\u001b[39;00m global_skip_validation\n\u001b[0;32m    214\u001b[0m         )\n\u001b[0;32m    215\u001b[0m     ):\n\u001b[1;32m--> 216\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m    217\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m InvalidParameterError \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m    218\u001b[0m     \u001b[38;5;66;03m# When the function is just a wrapper around an estimator, we allow\u001b[39;00m\n\u001b[0;32m    219\u001b[0m     \u001b[38;5;66;03m# the function to delegate validation to the estimator, but we replace\u001b[39;00m\n\u001b[0;32m    220\u001b[0m     \u001b[38;5;66;03m# the name of the estimator by the name of the function in the error\u001b[39;00m\n\u001b[0;32m    221\u001b[0m     \u001b[38;5;66;03m# message to avoid confusion.\u001b[39;00m\n\u001b[0;32m    222\u001b[0m     msg \u001b[38;5;241m=\u001b[39m re\u001b[38;5;241m.\u001b[39msub(\n\u001b[0;32m    223\u001b[0m         \u001b[38;5;124mr\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mparameter of \u001b[39m\u001b[38;5;124m\\\u001b[39m\u001b[38;5;124mw+ must be\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m    224\u001b[0m         \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mparameter of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfunc\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__qualname__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m must be\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m    225\u001b[0m         \u001b[38;5;28mstr\u001b[39m(e),\n\u001b[0;32m    226\u001b[0m     )\n",
      "File \u001b[1;32m~\\anaconda3\\Lib\\site-packages\\sklearn\\metrics\\_regression.py:1257\u001b[0m, in \u001b[0;36mr2_score\u001b[1;34m(y_true, y_pred, sample_weight, multioutput, force_finite)\u001b[0m\n\u001b[0;32m   1133\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\":math:`R^2` (coefficient of determination) regression score function.\u001b[39;00m\n\u001b[0;32m   1134\u001b[0m \n\u001b[0;32m   1135\u001b[0m \u001b[38;5;124;03mBest possible score is 1.0 and it can be negative (because the\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m   1250\u001b[0m \u001b[38;5;124;03m-inf\u001b[39;00m\n\u001b[0;32m   1251\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m   1252\u001b[0m xp, _, device_ \u001b[38;5;241m=\u001b[39m get_namespace_and_device(\n\u001b[0;32m   1253\u001b[0m     y_true, y_pred, sample_weight, multioutput\n\u001b[0;32m   1254\u001b[0m )\n\u001b[0;32m   1256\u001b[0m _, y_true, y_pred, sample_weight, multioutput \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m-> 1257\u001b[0m     _check_reg_targets_with_floating_dtype(\n\u001b[0;32m   1258\u001b[0m         y_true, y_pred, sample_weight, multioutput, xp\u001b[38;5;241m=\u001b[39mxp\n\u001b[0;32m   1259\u001b[0m     )\n\u001b[0;32m   1260\u001b[0m )\n\u001b[0;32m   1262\u001b[0m check_consistent_length(y_true, y_pred, sample_weight)\n\u001b[0;32m   1264\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _num_samples(y_pred) \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m2\u001b[39m:\n",
      "File \u001b[1;32m~\\anaconda3\\Lib\\site-packages\\sklearn\\metrics\\_regression.py:198\u001b[0m, in \u001b[0;36m_check_reg_targets_with_floating_dtype\u001b[1;34m(y_true, y_pred, sample_weight, multioutput, xp)\u001b[0m\n\u001b[0;32m    148\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Ensures that y_true, y_pred, and sample_weight correspond to the same\u001b[39;00m\n\u001b[0;32m    149\u001b[0m \u001b[38;5;124;03mregression task.\u001b[39;00m\n\u001b[0;32m    150\u001b[0m \n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    194\u001b[0m \u001b[38;5;124;03m    correct keyword.\u001b[39;00m\n\u001b[0;32m    195\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m    196\u001b[0m dtype_name \u001b[38;5;241m=\u001b[39m _find_matching_floating_dtype(y_true, y_pred, sample_weight, xp\u001b[38;5;241m=\u001b[39mxp)\n\u001b[1;32m--> 198\u001b[0m y_type, y_true, y_pred, multioutput \u001b[38;5;241m=\u001b[39m _check_reg_targets(\n\u001b[0;32m    199\u001b[0m     y_true, y_pred, multioutput, dtype\u001b[38;5;241m=\u001b[39mdtype_name, xp\u001b[38;5;241m=\u001b[39mxp\n\u001b[0;32m    200\u001b[0m )\n\u001b[0;32m    202\u001b[0m \u001b[38;5;66;03m# _check_reg_targets does not accept sample_weight as input.\u001b[39;00m\n\u001b[0;32m    203\u001b[0m \u001b[38;5;66;03m# Convert sample_weight's data type separately to match dtype_name.\u001b[39;00m\n\u001b[0;32m    204\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m sample_weight \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
      "File \u001b[1;32m~\\anaconda3\\Lib\\site-packages\\sklearn\\metrics\\_regression.py:104\u001b[0m, in \u001b[0;36m_check_reg_targets\u001b[1;34m(y_true, y_pred, multioutput, dtype, xp)\u001b[0m\n\u001b[0;32m     59\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Check that y_true and y_pred belong to the same regression task.\u001b[39;00m\n\u001b[0;32m     60\u001b[0m \n\u001b[0;32m     61\u001b[0m \u001b[38;5;124;03mTo reduce redundancy when calling `_find_matching_floating_dtype`,\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    100\u001b[0m \u001b[38;5;124;03m    correct keyword.\u001b[39;00m\n\u001b[0;32m    101\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m    102\u001b[0m xp, _ \u001b[38;5;241m=\u001b[39m get_namespace(y_true, y_pred, multioutput, xp\u001b[38;5;241m=\u001b[39mxp)\n\u001b[1;32m--> 104\u001b[0m check_consistent_length(y_true, y_pred)\n\u001b[0;32m    105\u001b[0m y_true \u001b[38;5;241m=\u001b[39m check_array(y_true, ensure_2d\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, dtype\u001b[38;5;241m=\u001b[39mdtype)\n\u001b[0;32m    106\u001b[0m y_pred \u001b[38;5;241m=\u001b[39m check_array(y_pred, ensure_2d\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, dtype\u001b[38;5;241m=\u001b[39mdtype)\n",
      "File \u001b[1;32m~\\anaconda3\\Lib\\site-packages\\sklearn\\utils\\validation.py:475\u001b[0m, in \u001b[0;36mcheck_consistent_length\u001b[1;34m(*arrays)\u001b[0m\n\u001b[0;32m    473\u001b[0m uniques \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39munique(lengths)\n\u001b[0;32m    474\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(uniques) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m--> 475\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[0;32m    476\u001b[0m         \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFound input variables with inconsistent numbers of samples: \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    477\u001b[0m         \u001b[38;5;241m%\u001b[39m [\u001b[38;5;28mint\u001b[39m(l) \u001b[38;5;28;01mfor\u001b[39;00m l \u001b[38;5;129;01min\u001b[39;00m lengths]\n\u001b[0;32m    478\u001b[0m     )\n",
      "\u001b[1;31mValueError\u001b[0m: Found input variables with inconsistent numbers of samples: [8, 10]"
     ]
    }
   ],
   "source": [
    "x_test=np.array([[103],[115],[90],[89],[60],[70],[50],[45],[55],[78]])\n",
    "y_test=np.array([[301],[344],[275],[206],[160],[124],[190],[235]])\n",
    "mse=np.average((y2-np.array(y))**2)\n",
    "rmse=np.sqrt(mse)\n",
    "r2=model.score(x_test,y_test)\n",
    "print(mse)\n",
    "print(rmse)\n",
    "print(r2)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
